package sctu.edu.java.year2016.team08.lisonghong.day20160601.chapter9_1;

import java.util.Scanner;

/**
 * Created by 松红 on 2016/6/1.
 */
public class Chapter9_1 {
    class Sum1 {
        Scanner input = new Scanner(System.in);
        int score = input.nextInt();

        public void sum1() {
            int sum = 0;
            for (int i = 1; i <= score; i++) {
                sum = sum + i;
            }
            System.out.println("1到" + score + "的和为：" + sum);
        }
    }

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Chapter9_1 test = new Chapter9_1();
        Sum1 test1 = test.new Sum1();
        test1.sum1();

    }
}
